package ch09.shili;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

//字符缓冲输入流
public class S09 {

    public static void main(String[] args) {
        try(BufferedReader reader = new BufferedReader(new FileReader("data/test8.txt"))){
            int i = 1;
            while (true){
                String line = reader.readLine();
                if(line == null){
                    break;
                }
                System.out.println(line + "\t" + i);
                i++;
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
